CSharpTest.Net
MinimumChildNodes Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.BPlusTree Assembly > CSharpTest.Net.Collections Namespace > BPlusTreeOptions<TKey,TValue> Class : MinimumChildNodes Property

Glossary Item Box

The smallest number of child nodes that should be linked to before refactoring the tree to remove this node. In a 'normal' and/or purest B+Tree this is always half of max; however for performance reasons this B+Tree allow any value equal to or less than half of max but at least 2.

Syntax

Visual Basic (Declaration) 
Public Property MinimumChildNodes As Integer
C# 
public int MinimumChildNodes {get; set;}

Property Value

A number in the range of 2 to 128 that is at most half of MaximumChildNodes.

Example

BPlusTree/BPlusTree.Test/TestBulkInsert.cs

C#Copy Code
BPlusTreeOptions<int, string> options = Options;
using (TempFile temp = new TempFile())
{
    options = Options;
    temp.Delete();
    //options.CreateFile = CreatePolicy.Always;
    //options.FileName = temp.TempPath;
    options.MaximumValueNodes = 14;
    options.MinimumValueNodes = 7;
    options.MaximumChildNodes = 6;
    options.MinimumChildNodes = 2;

    // Just to make sure we don't break some fencepost condition in the future
    for (int i = 0; i <= (options.MaximumValueNodes * options.MaximumChildNodes) + 1; i++)
        TestMergeSequenceInFile(options.Clone(), i);
    TestMergeSequenceInFile(options.Clone(), options.MaximumValueNodes * options.MaximumChildNodes * options.MaximumChildNodes);
    TestMergeSequenceInFile(options.Clone(), options.MaximumValueNodes * options.MaximumChildNodes * options.MaximumChildNodes + 1);
}
VB.NETCopy Code
Dim options As BPlusTreeOptions(Of Integer, String) = Options
Using temp As New TempFile()
    options = Options
    temp.Delete()
    'options.CreateFile = CreatePolicy.Always;
    'options.FileName = temp.TempPath;
    options.MaximumValueNodes = 14
    options.MinimumValueNodes = 7
    options.MaximumChildNodes = 6
    options.MinimumChildNodes = 2

    ' Just to make sure we don't break some fencepost condition in the future
    Dim i As Integer = 0
    While i <= (options.MaximumValueNodes * options.MaximumChildNodes) + 1
        TestMergeSequenceInFile(options.Clone(), i)
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
    End While
    TestMergeSequenceInFile(options.Clone(), options.MaximumValueNodes * options.MaximumChildNodes * options.MaximumChildNodes)
    TestMergeSequenceInFile(options.Clone(), options.MaximumValueNodes * options.MaximumChildNodes * options.MaximumChildNodes + 1)
End Using

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys